package com.lmn.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("test")
public class ControllerTest {
    private static final Logger LOG = LoggerFactory.getLogger(ControllerTest.class);

    @GetMapping("get")
    public String get(@RequestParam String name, int age) {
        LOG.info("name:" + name + "\tage:" + age);
        return "success";
    }

    @PutMapping("put")
    public String put(@RequestBody Body body) {
        LOG.info("body:" + body.toString());
        return "success";
    }

    @PostMapping("post")
    public String post(@RequestBody Body body) {
        LOG.info("body:" + body.toString());
        return "success";
    }

    @DeleteMapping("delete")
    public String delete(@RequestParam String id) {
        LOG.info("id:" + id);
        return "success";
    }
}
